#include <stdio.h>
#include <stdlib.h>

int sum(int [], int n);

int main(void)
{
    int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

    printf("%d\n", sum(a, 10));

    return 0;
}

int sum(int a[], int n)
{
    int r = 0;

    for (int i = 0; i < n; i++)
    {
        r += a[i];
    }

    return r;
}
